﻿<{include file="top_v3.html"}>
</head>
<body>

<{*轮播 开始*}>
<div class="flicking_con" >
    <div class="flicking_inner">
        <{foreach from=$marquee key=key item=item}>
        <a href="<{u('index/marqueJump?id='|cat:$item.id)}>"><{$key}></a>
        <{/foreach}>

    </div>
</div>
<div class="main_image">
    <ul>
        <{foreach from=$marquee item=item}>
        <li><a href="<{u('index/marqueJump?id='|cat:$item.id)}>"><img src="<{$preUploadUrl}><{$item.pic}>"></a></li>
        <{/foreach}>
    </ul>
    <a href="javascript:;" id="btn_prev"></a>
    <a href="javascript:;" id="btn_next"></a>
</div>
<{*轮播 结束*}>


<ul class="nav">
    <li><a class="integration" href="<{U('Point/pointDetail')}>"><i><{$userinfo.point}></i>积分</a></li>
    <li><a class="record" href="<{U('PointMall/exchangeLog')}>">兑换记录</a></li>
    <li><a class="rule" href="<{$POINT_RULE_URL}>">积分规则</a></li>
    <{if $switch==1}><li><a class="luckDraw" href="<{U('PointMall/dialLottery')}>">积分抽奖</a></li><{/if}>
</ul>

<{foreach from=$goodsType item=goodsTypeName key=goodsTypeId}>
    <{if count($list[$goodsTypeId]) gt 0}>
        <h3 class="topic"><span><{$goodsTypeName}></span><a href="<{u('goodsMore?gid='|cat:$goodsTypeId)}>">更多></a></h3>
        <div class="nub_box">
            <{foreach from=$list[$goodsTypeId] item=item }>
            <article class="nub_con">
                <a href="<{u('info/?id='|cat:$item['id'])}>">
                <{*<div class="graph"><span class="sec">秒抢</span></div> *}>
                <img src="<{$preUploadUrl}><{$item.listPic}>" />

                <{if $item.showStatus == 3}>
                    <dl class="hint timeCounter" data-time="<{$item.restTime}>">距开始&nbsp;&nbsp;&nbsp;04:32:12</dl>
                <{else if $item.showStatus == 2}>
                    <{if $item.showStock == 0}>
                    <dl class="over">已抢完</dl>
                    <{/if}>
                <{else if $item.showStatus == 4}>
                    <dl class="over">已结束</dl>
                <{/if}>
                <ul>
                    <li><{$item.titleList}></li>
                    <li>
                        <{* 显示积分与价格 *}>
                        <{if $item.point gt 0 and $item.nowPrice eq 0}>
                            <i><{$item.point}></i>积分
                        <{elseif  $item.point eq 0 and $item.nowPrice gt 0 }>
                            <i><{$item.nowPrice}></i>元
                        <{elseif  $item.point gt 0 and $item.nowPrice gt 0 }>
                            <i><{$item.point}></i>积分 +<i><{$item.nowPrice}></i>元
                        <{/if}>
                    </li>
                    <li>市场参考价：<{$item.originalPrice}>元</li>
                </ul>
                    </a>
            </article>
            <{/foreach}>

        </div>
    <{/if}>
<{/foreach}>

<{include file="footer.html"}>

</body>
</html>
<script type="text/javascript">
$(document).ready(function () {
	$(".main_visual").hover(function(){
		$("#btn_prev,#btn_next").fadeIn()
		},function(){
		$("#btn_prev,#btn_next").fadeOut()
		})
	$dragBln = false;
	$(".main_image").touchSlider({
		flexible : true,
		speed : 200,
		btn_prev : $("#btn_prev"),
		btn_next : $("#btn_next"),
		paging : $(".flicking_con a"),
		counter : function (e) {
			$(".flicking_con a").removeClass("on").eq(e.current-1).addClass("on");
		}
	});
	$(".main_image").bind("mousedown", function() {
		$dragBln = false;
	})
	$(".main_image").bind("dragstart", function() {
		$dragBln = true;
	})
	$(".main_image a").click(function() {
		if($dragBln) {
			return false;
		}
	})
	timer = setInterval(function() { $("#btn_next").click();}, 5000);
	$(".main_visual").hover(function() {
		clearInterval(timer);
	}, function() {
		timer = setInterval(function() { $("#btn_next").click();}, 5000);
	})
	$(".main_image").bind("touchstart", function() {
		clearInterval(timer);
	}).bind("touchend", function() {
		timer = setInterval(function() { $("#btn_next").click();}, 5000);
	})


    timeout();
    function timeout(){
        var $point_timeer = $('.timeCounter');
        $point_timeer.each(function() {
            var time = parseInt($(this).data("time"));
            if(time>0 && time){
                output_time(time,this);
            }
            $(this).data("time",--time);
        });
        setTimeout(function (){timeout();},1000);
    }
    function output_time (time,obj) {
        var hour = Math.floor(time/60/60);
        var minute = Math.floor((time/60)%60);
        var scond = Math.floor(time%60);
        var day = Math.floor(hour/24);

        if(hour>24){
            hour = hour%24;
            $(obj).html("距开始 "+day+"天"+hour+"小时");
        }else if(hour >= 1 && hour <=24){
            $(obj).html("距开始 "+hour+"小时"+minute+"分");
        }else if(hour <1){
            $(obj).html("距开始 "+minute+"分"+scond+"秒");
        }
    }
});
</script>
